package com.liam.es.config;

import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.elasticsearch.client.ClientConfiguration;
import org.springframework.data.elasticsearch.client.RestClients;

@Configuration
public class EsConfig {

//    @Value("${aliyunoss.yogoBucketName}")
//    private   String yogoBucketName;
//    @Value("${aliyunoss.yogoUrlBase}")
//    private  String yogoUrlBase;

        @Bean
        RestHighLevelClient elasticsearchClient() {
            ClientConfiguration configuration = ClientConfiguration.builder()
                    .connectedTo("192.168.6.162:9200")
                    .build();
            RestHighLevelClient client = RestClients.create(configuration).rest();

            return client;
        }

}
